﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace T3Task
{
    class DBHelper
    {
        //数据库连接字符串
       public static string ConnStr= "server=.;database=Task;Integrated Security=true";
        //数据库连接对象
        public static SqlConnection Conn = null;
        //初始化数据库连接
        public static void Conection()
        {
            //如果连接对象不存在，则创建连接
            if (Conn==null)
            {
                Conn = new SqlConnection(ConnStr);

            }
        }
    }
}
